package com.daiqile.myinterest.activity;

import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.widget.TextView;

import com.daiqile.myinterest.R;
import com.daiqile.myinterest.adapter.AllbankcardAdapter;
import com.daiqile.myinterest.model.AllBankcardList;
import com.daiqile.myinterest.utils.CommonItemDecoration;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class ForthActivity extends AppCompatActivity {
    @BindView(R.id.tv_l_one)
    TextView tvLOne;
    @BindView(R.id.tv_f_one)
    TextView tvFOne;
    @BindView(R.id.tv_s_one)
    TextView tvSOne;
    private AllbankcardAdapter adapter;
    private List<AllBankcardList.ListBean> ListBean = new ArrayList<>();
    @BindView(R.id.allbankcard_recycle_view)
    RecyclerView recyclerView;
    private int tvSHeight;
    private int tvFHeight;
    private int tvLHeight;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_forth);
        ButterKnife.bind(this);
        initList();
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        recyclerView.setLayoutManager(layoutManager);
        recyclerView.addItemDecoration(new CommonItemDecoration(10, 10, 10, 0));
        adapter = new AllbankcardAdapter(ListBean);
        recyclerView.setAdapter(adapter);
        ActionBar actionbar = getSupportActionBar();
        if (actionbar != null) {
            actionbar.setDisplayHomeAsUpEnabled(true);
        }

    }

    private void initList() {
        for (int i = 0; i < 10; i++) {
            AllBankcardList.ListBean id = new AllBankcardList.ListBean();
            ListBean.add(id);
        }
    }
    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
        super.onWindowFocusChanged(hasFocus);
        if (hasFocus) {
            tvSHeight = tvSOne.getHeight();
            tvFHeight = tvFOne.getHeight();
            tvLHeight = tvLOne.getHeight();
            Log.d("oneHeight", String.valueOf(tvSHeight));
            Log.d("twoHeight", String.valueOf(tvFHeight));
            Log.d("lunHeight", String.valueOf(tvLHeight));

        }
    }
}
